<template>
	<view>
		<chat></chat>
	</view>
</template>
<script>
	// var plugin = requirePlugin("myPlugin");
	export default {
		data() {
			return {
				uid: '',
				nickname: '',
				avatar: '',
				phone: '',
				vipName: '',
			}
		},
		onLoad: function() {
			this.uid = this._route.query.uid;
			this.nickname = this._route.query.nickname;
			this.avatar = this._route.query.avatar;
			this.phone = this._route.query.phone;
			this.vipName = this._route.query.vipName;
			plugin.init({
				sign: 'd30276ed081d752d4f7210ae7cb32954b8dd6e76325925528196b6ff38483260d56dae8b790e79671fde687c24eecf30fa3b7a880ce352299fa8fdb66f43c05b', //必传，公司渠道唯一标识
				token: '',
				userAvator: this.avatar, 
				userNick: this.nickname, 
				uid: this.uid, 
				title: '', 
				isRMB: '', 
				data: { 
					c1: this.phone,
					c2: this.vipName,
					c3: '',
					c4: '',
					c5: '',
					d1: '', 
					d2: '', 
					d3: '', 
					d4: '', 
					d5: '', 
					d6: '', 
					data: ''
				},
				viewUrl(res) {
					if (res) {
						wx.navigateTo({
							url: '/pages/webview/index?href=' + res
						})
					}
				},
				setTitle(res) { //设置标题
					if (res) {
						wx.setNavigationBarTitle({
							title: res
						})
					}
				},
				setBarColor(res) { //设置导航栏背景色
					if (res) {
						wx.setNavigationBarColor({
							frontColor: '#ffffff',
							backgroundColor: res
						})
					}
				},
				success(res) { //初始化成功时调用
					if (res.data == 'success') {}
				},
				fail(res) { //初始化失败时调用
					if (res.data == 'initError') {}
				},
				leave(res) { //离开会话页面
					if (res) {}
				}
			})
		},
		methods: {}
	}
</script>
